import request from '@/config/axios'

export interface PostVO {
  id?: number
  code: string
  name: string
  remark: string
  status: number
  sort: number
  createTime?: string
}

export const getPostSimpleList = async (status?: number) => {
  return await request.get({ url: '/system/post/simple-list', params: { status } })
}

export const getPostPage = async (params: PageParam) => {
  return await request.get({ url: '/system/post/page', params })
}

export const getPost = async (id: number) => {
  return await request.get({ url: '/system/post/get', params: { id } })
}

export const createPost = async (data: PostVO) => {
  return await request.post({ url: '/system/post/create', data: data })
}

export const updatePost = async (data: PostVO) => {
  return await request.post({ url: '/system/post/update', data: data })
}

export const deletePost = async (id: number) => {
  return await request.delete({ url: '/system/post/delete', params: { id } })
}

export const exportPost = async (params: any) => {
  return await request.download({ url: '/system/post/export', params })
}
